package chat

import (
	"sanguo/cluster"
	"sanguo/codec/cs"
)

var encoder *cs.Encoder

const (
	MaxChatMsg = 50 //聊天
)

type RoleData struct {
	RoleID   uint64
	Name     string
	Level    int32
	Portrait int32 //头像
}

type Role struct {
	RoleData
	Game     cluster.PeerID
	UserID   string
	teamChat *Chat
	mapChat  *Chat
}

func (this *Role) GetRoleID() uint64 {
	return this.RoleID
}

func (this *Role) GetTeamChat() *Chat {
	return this.teamChat
}

func (this *Role) SetTeamChat(teamChat *Chat) {
	this.teamChat = teamChat
}

func (this *Role) GetMapChat() *Chat {
	return this.mapChat
}

func (this *Role) SetMapChat(mapChat *Chat) {
	this.mapChat = mapChat
}

func init() {
	encoder = cs.NewEncoder("sc")
}
